<?php
/**
 * @ClassName: ContactsLogic
 * @Description: TODO
 * @author: gydtrade
 * @Date: 2025-11-20 13:11
 * @Version: V1.0.0
 */

namespace app\common\logic;

use app\common\model;

class ContactsLogic
{
    /**
     * 判断会员是否绑定过
     * @param $member_id
     * @param $contacts_id
     * @return model\CustomerContacts
     */
    function isBindMember($member_id, $contacts_id = '')
    {
        $bind_member = '';
        if ($member_id) {
            if ($contacts_id) {
                $bind_member = model\CustomerContacts::where('id', '<>', $contacts_id)->where('member_id', $member_id)->find();
            } else {
                $bind_member = model\CustomerContacts::where('member_id', $member_id)->find();
            }
        }
        return $bind_member;
    }

}